header {
    #include <sstream>
    #include <iostream>
    #include <QDomDocument>
    #include <QStringList>
    #include <Oz/Mpl/UnicodeCharBuffer.hpp>
    #include <Oz/Mpl/UnicodeCharScanner.hpp>
}

options {
    language="Cpp";
}

class MplParser extends Parser;

options {
    buildAST = true;
    importVocab=Mpl;
    k = 2;
}

mpl_module_definition:
    {
        std::cerr<<"mpl_module_definition begin"<<std::endl;
    }
    MODULEKEYWORD (WS)+ mpl_identifier (WS)* LCURLY (WS)* 
        (mpl_class_definition)* 
    (WS)* RCURLY (WS)* SEMI
    {
        std::cerr<<"mpl_module_definition end"<<std::endl;
    };

mpl_class_definition:
    {
        std::cerr<<"mpl_class_definition begin"<<std::endl;
    }
    CLASSKEYWORD (WS)+ mpl_identifier (WS)+ LCURLY (WS)+
    (mpl_attriubte_definition)*
    RCURLY (WS)? SEMI
    {
        std::cerr<<"mpl_class_definition end"<<std::endl;
    };

mpl_interface_definition:
    {

    }
    INTERFACEKEYWORD (WS)+ mpl_identifier (WS)+ LCURLY (WS)+
        
    {
    };

mpl_attriubte_definition:
    {
        std::cerr<<"begin mpl_attriubte_definition"<<std::endl;
    }
    (mpl_anotation)* mpl_type (WS)? mpl_identifier (WS)? SEMI
    {
        std::cerr<<"end mpl_attriubte_definition"<<std::endl;
    };

mpl_anotation:
    {
        std::cerr<<"anotation begin"<<std::endl;
    }
    LBRACK (WS)? mpl_identifier (WS)? ASSIGN (WS)? mpl_identifier (WS)? RBRACK
    {
        std::cerr<<"anotation end"<<std::endl;
    };

mpl_type:
    {
        std::cerr<<"mpl_type begin"<<std::endl;
    }
    (mpl_type_int | mpl_type_string )
    {
        std::cerr<<"mpl_type end"<<std::endl;
    };

/**
 * Mpl types
 **/
mpl_type_int:
    {}
    MPLINT
    {};

mpl_type_string:
    {}
    MPLSTRING
    {};

mpl_type_byte:
    {}
    MPLBYTE
    {};

mpl_type_uuid:
    {}
    MPLUUID
    {};

mpl_type_float:
    {}
    MPLFLOAT
    {};

mpl_type_long:
    {}
    MPLLONG
    {};

/**
 * This rule match valid mpl identitfiers.
 */
mpl_identifier:
    {
        std::cerr<<"mpl_identifier begin"<<std::endl;
    }
    IDENT
    {
        std::cerr<<"mpl_identifier end"<<std::endl;
    };